package repositoryXML;

import java.beans.XMLEncoder;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import repository.ITaskRepository;

import domain.Task;

public class TaskRepositoryXML implements ITaskRepository {
	
	/* (non-Javadoc)
	 * @see repository.ITaskRepository#saveTask(domain.Task)
	 */
	public void saveTask(Task t){
		  // Create output stream.
		  FileOutputStream fos;
		try {
			fos = new FileOutputStream("c:\\foo.xml");
			  // Create XML encoder.
			  XMLEncoder xenc = new XMLEncoder(fos);

			  // Write object.
			  xenc.writeObject(t);
			  xenc.close();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
